package com.swpu.service_drink.controller;


import com.swpu.commonutils.R;
import com.swpu.service_drink.entity.Drink;
import com.swpu.service_drink.service.DrinkService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chaichai
 * @since 2024-02-28
 */
@RestController
@RequestMapping("/service_drink/drink")
public class DrinkController {

    @Autowired
    private DrinkService drinkService;
    @GetMapping("getAllDrinkCategory")
    public R getAllDrinkCategory(){
        List<Drink> allDrinkCategory = drinkService.getAllDrinkCategory();
        return R.ok().data("drinkCategories",allDrinkCategory);
    }
}

